package vivek.project.pocketmoney.expenses.model
{
	import vivek.project.pocketmoney.admin.model.AdminConstants;
	import vivek.project.pocketmoney.common.utils.CommonConstants;
	import vivek.project.pocketmoney.common.utils.DateUtils;

	public class QIFBankLoader extends AccountLoaderImpl
	{
		private static var iciciBankLoader:QIFBankLoader=null;

		private const delimiter:String="^";

		private const numCols:int=7;

		private const dataStart:int=10;

		private const bankName:String="IDBI";

		public function QIFBankLoader()
		{
			dateFormat="DD/MM/YYYY";
			categoryMatch.push({matchString: "int", catid: 29});
			categoryMatch.push({matchString: "IP AMT", catid: 9});
		}

		public static function getInstance():QIFBankLoader
		{
			if (iciciBankLoader == null)
				iciciBankLoader=new QIFBankLoader();
			return iciciBankLoader;
		}

		override public function checkValiditiy(fileContent:String):Boolean
		{
			return false;
		}

		override public function getExpenseRecords(fileContent:String, account:Object):Array
		{
			var txnrecords:Array;
			var txntype:int=CommonConstants.WITHDRAWAL;
			var amount:Number=0;
			txnrecords=loadExpenseDataQIF(fileContent);
			var expenseRecords:Array=new Array();
			for each (var obj:Object in txnrecords)
			{
				obj.account=account.am_accountid;
				obj.category=24;
				obj.payee=0;
				obj.date=DateUtils.getDateFromString(dateFormat, obj.date);
				expenseRecords.push(obj);
			}
			return expenseRecords;
		}
	}
}